package swt_1;

import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Spinner;

public class MyDialog extends Dialog {

	protected Object result;
	protected Shell shell;
	private Text text;
	private Text text_1;
	

	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public MyDialog(Shell parent, int style) {
		super(parent, style);
		setText("SWT Dialog");
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
		shell.setSize(537, 455);
		shell.setText("凑你的爷");
		
		Label lblNewLabel = new Label(shell, SWT.NONE);
		lblNewLabel.setBounds(10, 10, 90, 24);
		lblNewLabel.setText("用户名:");
		
		Label lblNewLabel_1 = new Label(shell, SWT.NONE);
		lblNewLabel_1.setBounds(10, 51, 90, 24);
		lblNewLabel_1.setText("密码:");
		
		Label lblNewLabel_2 = new Label(shell, SWT.NONE);
		lblNewLabel_2.setBounds(10, 94, 90, 24);
		lblNewLabel_2.setText("学历:");
		
		Label lblNewLabel_3 = new Label(shell, SWT.NONE);
		lblNewLabel_3.setBounds(10, 134, 90, 24);
		lblNewLabel_3.setText("社团:");
		
		Label lblNewLabel_4 = new Label(shell, SWT.NONE);
		lblNewLabel_4.setBounds(10, 192, 90, 24);
		lblNewLabel_4.setText("籍贯:");
		
		Label lblNewLabel_5 = new Label(shell, SWT.NONE);
		lblNewLabel_5.setBounds(10, 249, 90, 24);
		lblNewLabel_5.setText("工资:");
		
		text = new Text(shell, SWT.BORDER);
		text.setBounds(122, 10, 323, 24);
		
		text_1 = new Text(shell, SWT.BORDER | SWT.PASSWORD);
		text_1.setBounds(122, 51, 323, 24);
		
		Button button = new Button(shell, SWT.RADIO);
		button.setText("高中");
		button.setBounds(122, 94, 141, 24);
		
		Button button_1 = new Button(shell, SWT.RADIO);
		button_1.setText("专科");
		button_1.setBounds(269, 94, 141, 24);
		
		Button button_1_1 = new Button(shell, SWT.RADIO);
		button_1_1.setText("本科");
		button_1_1.setBounds(416, 94, 141, 24);
		
		Button button_2 = new Button(shell, SWT.CHECK);
		button_2.setBounds(120, 147, 143, 24);
		button_2.setText("读书沙龙");
		
		Button button_3 = new Button(shell, SWT.CHECK);
		button_3.setBounds(267, 147, 143, 24);
		button_3.setText("云顶协会");
		
		Combo combo = new Combo(shell, SWT.NONE);
		combo.setBounds(122, 192, 323, 24);
		
		Spinner spinner = new Spinner(shell, SWT.BORDER);
		spinner.setBounds(123, 241, 322, 32);
		
		Button button_4 = new Button(shell, SWT.NONE);
		button_4.setBounds(122, 317, 114, 34);
		button_4.setText("保存");
		
		Button button_5 = new Button(shell, SWT.NONE);
		button_5.setBounds(299, 317, 114, 34);
		button_5.setText("取消");

	}

}
